import { IpcWindow } from "@/util/IpcWindow/IpcWindow";
import { CreateExchangeDto } from "@/mdesign-lib/mdesign-app.umd.js";
import { WindowName } from "@/mdesign-lib/mdesign-main.js";

export type Params = {
  projectId: string;
  relationId?: string;
  firstEndId?: string;
  secondEndId?: string;
  stereotype: string;
  isDirection?: boolean;
  conveyedId?: string;
  showSendingAndReceiving?: boolean;
};

export type CloseData = {
  windowName: string;
  success: boolean;
  updatedExchangeId?: string;
  itemflowData?: Omit<CreateExchangeDto, "diagramId" | "sourceShapeId" | "targetShapeId">;
};
export const CreateExchangeWindow = new IpcWindow<
  // 参数
  Params,
  // 返回值
  CloseData
>(WindowName.CreateExchangeWindow);
